{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<div id="upgrade-history-section">
  <div {{bindAttr class="view.isReady:hide:show :screensaver :no-borders "}}>
    {{view App.SpinnerView}}
  </div>
  <div {{bindAttr class="view.isReady::hidden"}}>
	  <div class="btn-group display-inline-block">
	    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
	      <span class="filters-label">{{t common.filter}}: </span>
	        <span>
	          {{view.selectedCategory.label}}
	          <span class="caret"></span>
	        </span>
	    </a>
	    <ul class="dropdown-menu">
	      {{#each category in view.categories}}
	        <li>
	          <a {{action selectCategory category target="view"}} href="#">
	            {{category.label}}
	          </a>
	        </li>
	      {{/each}}
	    </ul>
	  </div>
	  <br/>
	  <br/>
	  <table class="table advanced-header-table table-striped" id="upgrade-summary-table">
	    <thead>
	      <th>{{t common.direction}}</th>
	      <th>{{t common.type}}</th>
	      <th>{{t common.from.version}}</th>
	      <th>{{t common.to.version}}</th>
	      <th>{{t common.start.time}}</th>
	      <th>{{t common.duration}}</th>
	      <th>{{t common.end.time}}</th>
	      <th>{{t common.status}}</th>
	    </thead>
	    <tbody>
		    {{#if view.pageContent}}
		      {{#each item in view.pageContent}}
		        <tr>
		          <td class='name'>
		            <span class="trim_hostname">
		              <a href="#" class="black" {{action "showUpgradeHistoryRecord" item target="view"}}>
		                {{unbound item.directionLabel}}
		              </a>
		            </span>
		          </td>
		          <td>
		            <span>{{item.upgradeTypeLabel}}</span>
		          </td>
		          <td>
		            <span>{{item.fromVersion}}</span>
		          </td>
		          <td>
		            <span>{{item.toVersion}}</span>
		          </td>
		          <td>
		            <span>{{item.startTimeLabel}}</span>
		          </td>
		          <td>
	              <span>{{item.duration}}</span>
	            </td>
		          <td>
		            <span>{{item.endTimeLabel}}</span>
		          </td>
		          <td>
		            <span>{{item.requestStatus}}</span>
		          </td>
		        </tr>
		      {{/each}}
		    {{/if}}
	    </tbody>
	  </table>
	  <div class="page-bar">
	    <div class="items-on-page">
	      <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
	    </div>
	    <div class="info">{{view.paginationInfo}}</div>
	    <div class="paging_two_button">
	      <a {{bindAttr class="view.paginationLeftClass"}}{{action previousPage target="view"}}><i
	              class="icon-arrow-left"></i></a>
	      <a {{bindAttr class="view.paginationRightClass"}}{{action nextPage target="view"}}><i
	              class="icon-arrow-right"></i></a>
	    </div>
	  </div>
  </div>
</div>